Take Screenshot
AutomatR.Web.TakeScreenshot
The "Take Screenshot" activity in AutomatR is designed for UI automation workflows, allowing you to capture screenshots of specified UI elements. This activity is useful for visual inspection and documentation of automation processes.
NOTE: If the Take Screenshot is added inside the Application/Browser activity, only the targeted application is snapshotted. If added outside of an application card, since there is no target specified, the entire desktop is captured.
Properties
Name | Description |
---|---|
Input | |
ClipBoard | Enables the option to copy the captured screenshot to the clipboard, making it accessible for use in other activities (e.g., clipboard activities). Boolean variables to enable or disable this option. |
File Path | Specifies the location and file name for saving the captured screenshot on the local drive. Enter a string containing the full path (e.g., D:\test\image.png). |
Misc | |
Display Name | Provides a customizable name for the activity displayed in the workflow. String variables containing the desired display name. |
Optional | |
Delay | Specifies the amount of time (in seconds) to wait before executing the "Take Screenshot" activity. This can be useful for handling synchronization issues or waiting for the UI element to be in the desired state. Integer variables containing the delay duration. Ex.: If the amount of time is 1000 milliseconds or 1 sec, i.e., 1. |
Output | |
Screenshot | Outputs the captured screenshot as an image variable, allowing you to use it elsewhere in the workflow. Variables of the Image type to store the captured screenshot. |
How to use:
- Drag and drop the "Take Screenshot" activity onto the workflow.
- Configure the properties based on the desired behavior:
- Choose whether to copy the screenshot to the clipboard (
ClipBoard
). - Set the delay time if needed (
Delay
). - Provide the file path if you want to save the screenshot locally (
File Path
).
- Choose whether to copy the screenshot to the clipboard (
- Execute the workflow to capture the screenshot.
Example: Consider an example where the "Take Screenshot" activity is used to capture a screenshot of a specific UI element with a delay of 3 seconds and save it to the local drive:
Take Screenshot:
Delay: 3 (seconds)
File Path: "D:\Screenshots\MyScreenshot.png"
Screenshot: capturedImage
In this example, the activity captures a screenshot after a delay of 3 seconds and saves it to the specified file path. The captured screenshot is stored in the capturedImage
variable for further use in the workflow.